﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Client
{
	class Program
	{
		static void Main(string[] args)
		{
			var filename = @"C:\Users\www\Downloads\时尚芭莎H5_V5.0.psd";
			var url = "http://localhost:51137/Default.aspx";
			var client = new UploadClient(url);

			var clientFile = new ClientFileInfo(filename);
			

			client.Connect();
			client.Help();
			client.Helo();
			client.Conf();
			client.Shnd(clientFile);

			using (var reader = System.IO.File.OpenRead(filename))
			{
				client.Uplo(reader, delegate (long pos, long size) {
					Console.WriteLine("{0}/{1}", pos, size);
				});
			}
			client.Done();

			//Console.WriteLine(res);

			Console.ReadLine();
			
		}
	}
}
